/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package OrchestrationLanguage.impl;

import OrchestrationLanguage.OrchestrationLanguagePackage;
import OrchestrationLanguage.Variable;
import OrchestrationLanguage.Variable_Declaration;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Variable Declaration</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link OrchestrationLanguage.impl.Variable_DeclarationImpl#getDeclare <em>Declare</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class Variable_DeclarationImpl extends CommandImpl implements Variable_Declaration {
	/**
	 * The cached value of the '{@link #getDeclare() <em>Declare</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDeclare()
	 * @generated
	 * @ordered
	 */
	protected Variable declare;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected Variable_DeclarationImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return OrchestrationLanguagePackage.Literals.VARIABLE_DECLARATION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Variable getDeclare() {
		if (declare != null && declare.eIsProxy()) {
			InternalEObject oldDeclare = (InternalEObject)declare;
			declare = (Variable)eResolveProxy(oldDeclare);
			if (declare != oldDeclare) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OrchestrationLanguagePackage.VARIABLE_DECLARATION__DECLARE, oldDeclare, declare));
			}
		}
		return declare;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Variable basicGetDeclare() {
		return declare;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDeclare(Variable newDeclare) {
		Variable oldDeclare = declare;
		declare = newDeclare;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OrchestrationLanguagePackage.VARIABLE_DECLARATION__DECLARE, oldDeclare, declare));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case OrchestrationLanguagePackage.VARIABLE_DECLARATION__DECLARE:
				if (resolve) return getDeclare();
				return basicGetDeclare();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case OrchestrationLanguagePackage.VARIABLE_DECLARATION__DECLARE:
				setDeclare((Variable)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case OrchestrationLanguagePackage.VARIABLE_DECLARATION__DECLARE:
				setDeclare((Variable)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case OrchestrationLanguagePackage.VARIABLE_DECLARATION__DECLARE:
				return declare != null;
		}
		return super.eIsSet(featureID);
	}

} //Variable_DeclarationImpl
